﻿/*
Copyright © 2010 François Karman

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

See <license.txt> for the complete license of the software.
*/

using System;

namespace MSBuild.Mercurial
{
    /// <summary>
    /// Defines the Mercurial command associated with a MSBuild task.
    /// </summary>
    /// <remarks>
    /// This information is provided through an attribute to use the same
    /// approach than for the <see cref="ParameterAttribute"/>.
    /// </remarks>
    [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)]
    public sealed class CommandAttribute : Attribute
    {
        /// <summary>
        /// Initializes a new instance of the CommandAttribute class.
        /// </summary>
        /// <param name="command">
        /// The Mercurial command associated with the tagged class.
        /// </param>
        public CommandAttribute(string command)
        {
            this.Command = command;
        }

        /// <summary>
        /// Gets the Mercurial command associated with the tagged class.
        /// </summary>
        public string Command { get; private set; }

        /// <summary>
        /// Gets or sets a suffix applied to all generated commands.
        /// </summary>
        /// <remarks>
        /// This property is used when a constant should be placed
        /// after the default parameter.
        /// </remarks>
        public string Suffix { get; set; }
    }
}
